<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/common/jsp/commonres.jsp"></jsp:include>
<script type="text/javascript" src="mainFrame.js"></script>
<link rel="stylesheet"
	href="${basePath}/jslib/easyui/themes/opmex/common.css" type="text/css"/>

</head>
<body class="easyui-layout">

	<div id="uinfo"
		style="text-align:center; font-size:14px; line-height:21px; background:#cbe7f1; position:absolute;right:120px;top:25px; z-index:100; width:100px;height:50px;  display: none;"
		onmouseout="hideInfo()" onmouseover="showInfo()">
		<a href="#" onclick="editOldUser()">修改资料</a><br> <a href="#"
			onclick="changePwd()">修改密码</a>
	</div>
	<div id="chgpwd" class="easyui-dialog"
		style="width:300px;height:230px;padding:10px 20px" closed="true"
		buttons="#edit-buttons" modal="true">
		<form id="pwdfm" method="post" novalidate>
			<input id="usoid" type="hidden" value="${loginUser.uuid}">
			<table class="dialog_table">
				<tr>
					<td>原始密码：</td>
					<td><input name="user.password" id="opwd" type="password"
						class="easyui-validatebox dialog_text" required="true"
						validType="length[6,9999]" invalidMessage="密码不能少于6位"></td>
				</tr>
				<tr>
					<td>新密码：</td>
					<td><input name="user.username" id="npwd" type="password"
						class="easyui-validatebox dialog_text" required="true"
						validType="length[6,9999]" invalidMessage="密码不能少于6位"></td>
				</tr>
				<tr>
					<td>确认密码：</td>
					<td><input id="rpwd" type="password"
						class="easyui-validatebox dialog_text" required="true"
						validType="equals['#npwd']"></td>
				</tr>

			</table>
		</form>
	</div>
	<div id="edit-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-ok" onclick="savePwd()">确认</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-cancel"
			onclick="javascript:$('#chgpwd').dialog('close')">取消</a>
	</div>
	<div id="editolduser" class="easyui-dialog"
		style="width:300px;height:260px;padding:10px 20px" closed="true"
		buttons="#edit-olduser-buttons" modal="true">
		<form id="edituserold" method="post" novalidate>
			<input name="user.uuid" id="usooid" type="hidden"
				value="${loginUser.uuid}">
			<table class="dialog_table">
				<tr>
					<td>用户名：</td>
					<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;【 ${loginUser.username} 】</td>
				</tr> 
				<tr>
				    <td>显示名：</td>
				    <td>
				        <input name="user.displayName" id="displayname" class="easyui-validatebox dialog_text"
				                value="${loginUser.displayName }" type="text"/>
				    </td>
				</tr>
				<tr>
					<td>电 话：</td>
					<td><input name="user.phone" id="uutel" type="text"
						class="easyui-validatebox dialog_text" value="${loginUser.phone}"
						validType="length[11,11]" invalidMessage="手机号为11位"></td>
				</tr>	
				<tr>
				    <td>地址：</td>
				    <td><input name="user.address" id="address" type="text"
				    class="easyui-validatebox dialog_text" value="${loginUser.address }"/></td>
				</tr>			
			</table>
		</form>
	</div>
	<div id="edit-olduser-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-ok" onclick="saveEditOldUser()">确认</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-cancel"
			onclick="javascript:$('#editolduser').dialog('close')">取消</a>
	</div>
	
	<!-- 修改组织信息    Begin -->
	<div id="organization_dlg" class="easyui-dialog"
        style="width:500px;height:310px;padding:10px" closed="true"
        buttons="#organization_dlg-buttons" modal="true">
        <form id="organization_form" method="post">
        <input name="organization.uuid" id="usooid" type="hidden"
                value="${loginUser.organization.uuid}">
            <table class="dialog_table">
                <tr>
                    <td style="width: 50px">名称：</td>
                    <td><input name="organization.name" id="organization_name"
                        class="easyui-validatebox dialog_text" required="true"  
                        value="${loginUser.organization.name}"                    
                        > </td>
                    <td></td>
                    <td>地址：</td>
                    <td><input id="organization_address" name="organization.address"
                        class="easyui-validatebox dialog_text" 
                        value="${loginUser.organization.address}"/></td> 
                </tr>
                <tr>
                    <td style="width: 50px">联系电话：</td>
                    <td><input name="organization.phone" id="organization_phone" class="easyui-validatebox dialog_text"                     
                        value="${loginUser.organization.phone}"> </td>
                    <td></td>
                </tr>
                <tr>
                    <td  valign="top">备注：</td>
                    <td colspan="4"><textarea  name="organization.description" 
                        id="organization_description" 
                        >${loginUser.organization.description}</textarea>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div id="organization_dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton"
            iconCls="icon-ok" onclick="mainFrame.saveEditOrganization()">保存</a> 
        <a href="javascript:void(0)" class="easyui-linkbutton"
            iconCls="icon-cancel"
            onclick="javascript:$('#organization_dlg').dialog('close')">取消</a>
    </div>
    <!-- 修改组织信息    End -->

	<div data-options="region:'north'"
		style="height:40px; background:#f3fbfd url(${basePath}/jslib/easyui/themes/opmex/images/logo.png) no-repeat left 5px;">
		<!-- 添加上部内容  begin-->
		<div style="float:right;margin: 5px 5px 0 0; ">
			<a href="javascript:logout()" class="easyui-linkbutton"
				data-options="plain:true,iconCls:'icon-logout'">注销</a> <a
				href="javascript:logclose()" class="easyui-linkbutton"
				data-options="plain:true,iconCls:'icon-exit'" onclick="">退出</a>
		</div>
		<div style="float:right;margin:5px 10px 0;">
			<div>
				欢迎您：<a href="#" class="easyui-splitbutton"
					data-options="menu:'#splitmn',iconCls:'icon-user'">${loginUser.username}</a>
				<s:if test="#session.loginUser.organization.type==0">
				        所属组织：
				</s:if>	
				<s:else>
				        所属外协： 
				</s:else>
				
				<s:if test="#session.loginUserPermission.contains('organization.maintenance')">
				    <a href="javascript:void(0)" class="easyui-linkbutton"
                        iconCls="icon-edit" plain="true" style="margin-left: -10px"
                        onclick="mainFrame.initEditOrganization(${loginUser.organization.type})">
                        ${loginUser.organization.name}</a>
				</s:if>
				<s:else>
				    ${loginUser.organization.name}
				</s:else>
			         			          	
			</div>
		</div>
		<div id="splitmn">
			<div onclick="editOldUser()" data-options="iconCls:'icon-edit'">修改资料</div>
			<div onclick="changePwd()" data-options="iconCls:'icon-edit'">修改密码</div>
		</div>
		<!-- 添加上部内容  end-->
	</div>
	<div data-options="region:'south'" style="height:25px; color:#666;" >
		<p style="text-align:center;margin:5px 0 0;">CopyRight@2011-2014
			深圳市施泰信息技术有限公司版权所有</p>
	</div>
	<div id="mainframe_title"
        title="  "     
		data-options="region:'west',split:true, iconCls:'icon-menu_nav'" style="width:150px;">
		<div id="mainframe_accordion" class="easyui-accordion"
			data-options="fit:true,border:true"></div>
	</div>
	<div data-options="region:'center',border:false">
		<div id="mainframe_tabs" class="easyui-tabs" data-options="fit:true">
		</div>
	</div>
</body>
</html>